#!/usr/bin/env python
# -*- coding: utf-8 -*-

from urllib import request

HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'}

def get_html(url):
    req = request.Request(url, headers=HEADERS)
    with request.urlopen(req) as f:
        return f.read().decode('utf-8')
    
if __name__ == '__main__':
    print(get_html('http://www.baidu.com'))